package cn.wujiangbo.test;

/**
 * @description: 线程知识回顾
 * @auth: wujiangbo
 * @date: 2022-04-02 14:04
 */
public class Thread_0 {

    public static void main(String[] args) {
        System.out.println("调用run方法：" + Thread.currentThread().getName());
        new MyThread("波波老师").run();

        System.out.println("调用start方法：" + Thread.currentThread().getName());
        new MyThread("波波老师").start();
    }
}

//线程类
class MyThread extends Thread{

    private String name;

    //构造函数
    public MyThread(String name){
        this.name = name;
    }

    //线程体
    @Override
    public void run() {
        System.out.println(name + "来了：" + Thread.currentThread().getName());
    }
}